<?php

namespace App\Modules\Home\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * Class Task 任务
 * @package App\Modules\Task\Models
 */
class Device extends Model
{
    protected $table = 'device';

    protected $fillable = ['id', 'facory_id', 'device_code', 'device_name', 'bundled_date', 'is_bundled', 'bundled_user_id', 'created_at', 'updated_at', 'status'];

    static function getList($param)
    {
        return self::where('status','>=',0)->paginate($param['size']);
    }


    static function getDetails($id)
    {
        return self::where('id',$id)->first();
    }

    static function add($param)
    {
        // TODO check
        return self::create($param);
    }


    static function modify($param)
    {
        // TODO check
        return self::where('id',$param['id'])->update($param);
    }
}